// Storing key-value data on disk

// Directions
// Add the dependency : shared_preferences
// Save Data
// Read Data
// Remove Data

// obtain shared preferences
import 'package:shared_preferences/shared_preferences.dart';
import 'dart:async';

void main() async {
// Only primitive types can be used: int, double, bool, string and stringList
// It’s not designed to store a lot of data.
  final prefs = await SharedPreferences.getInstance();

// set value
  prefs.setInt('counter', 1);

// Try reading data from the counter key. If it does not exist, return 0.
  final counter = prefs.getInt('counter') ?? 0;

  prefs.remove('counter');
}
